﻿CREATE FUNCTION [sp_ssiscatalog].[get_execution_result_desc_from_execution_result]
(
	@execution_result		smallint
)
RETURNS	TABLE AS
		RETURN
		SELECT	[execution_result_desc]=	CONVERT(NVARCHAR(MAX),		CASE	WHEN	@execution_result	=	0		THEN	'success'
																				WHEN	@execution_result	=	1		THEN	'failure'
																				WHEN	@execution_result	=	2		THEN	'completion'
																				WHEN	@execution_result	=	3		THEN	'canceled'
																				ELSE	NULL
																		END
							)                                                    